-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNOW-1480775 Collect Span Info from Copyable and Updatable Dataframes #119
Conversation
sfc-gh-bli
commented
Jul 11, 2024
- Collect Span Info from Copyable and Updatable Dataframes
- Improve the test function to automatically detect line numbers
- Add Java offset to action functions
@@ -12,21 +12,17 @@ object OpenTelemetry extends Logging { | |||
val spanInfo = new DynamicVariable[Option[SpanInfo]](None) | |||
|
|||
// wrapper of all action functions | |||
def action[T](className: String, funcName: String, isScala: Boolean)(func: => T): T = { | |||
def action[T](className: String, funcName: String, isScala: Boolean, javaOffSet: Int = 0)( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
introduced javaOffset
parameter. In some cases, Java API wrapped more than one layers on Scala API.
@@ -366,4 +440,15 @@ class OpenTelemetrySuite extends OpenTelemetryEnabled { | |||
} | |||
|
|||
private val stageName1 = randomName() | |||
|
|||
def checkSpan(className: String, funcName: String, methodChain: String): Unit = { | |||
val stack = Thread.currentThread().getStackTrace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I improved this function, now, it can automatically detect line numbers in tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like only a few action functions needs offset. I feel like it is a bit fragile since change of the way calling action function could break the offset. Do you think we are going to make changes on the way we call those action functions in the future?
val index = if (isScala) 4 else 5 + javaOffSet
val fileName = stacks(index).getFileName
val lineNumber = stacks(index).getLineNumber Default stack index of Scala API is 4, and the Java One is 5. In future if the change of |